
public class AntRoute implements Comparable<AntRoute> {
		private final Ant start;

		private final Tile end;

		private final int distance;

		public AntRoute(Ant start, Tile end, int distance) {
			this.start = start;
			this.end = end;
			this.distance = distance;
		}

		public Ant getStart() {
			return start;
		}

		public Tile getEnd() {
			return end;
		}

		public int getDistance() {
			return distance;
		}

		@Override
		public int compareTo(AntRoute route) {
			return distance - route.distance;
		}

		@Override
		public int hashCode() {
			return start.hashCode() * Ants.MAX_MAP_SIZE * Ants.MAX_MAP_SIZE
					+ end.hashCode();
		}

		@Override
		public boolean equals(Object o) {
			boolean result = false;
			if (o instanceof AntRoute) {
				AntRoute route = (AntRoute) o;
				result = start.getPosition().equals(route.start.getPosition()) && end.equals(route.end);
			}
			return result;
		}
}
